package com.fzhucc.modules.security.repository;

import com.fzhucc.modules.security.domain.UserCode;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

/**
* @website https://eladmin.vip
* @author yyg
* @date 2023-10-07
**/
public interface UserCodeRepository extends JpaRepository<UserCode, Integer>, JpaSpecificationExecutor<UserCode> {

    @Query("SELECT a from UserCode as a where a.phone=:phone")
    UserCode findByPhone(String phone);

    @Query("SELECT a from UserCode as a where a.code=:code")
    UserCode findByCode(String code);
}